﻿using AutomatedAcceptanceTests.IOC;
using TechTalk.SpecFlow;

namespace AutomatedAcceptanceTests.Infrastructure
{
    [Binding]
    public class SpecFlowSetUp
    {
        [BeforeTestRun]
        public static void BeforeTestRun()
        {
            //InitAutofac.Init();
        }


        [BeforeFeature]
        public static void BeforeFeature()
        {

        }

        [BeforeScenario]
        public void BeforeScenario()
        {

        }

        [AfterScenario]
        public void AfterScenario()
        {
            if (Browser.BrowserInstance.WebDriver != null)
            {
                Browser.BrowserInstance.WebDriver.Quit();
                Browser.BrowserInstance.WebDriver = null;
                WebDriverFactory.SetWebDriver(null);
            }
        }

        [AfterFeature]
        public static void AfterFeature()
        {
            
        }

        [AfterTestRun]
        public static void AfterTestRun()
        {
            //TBD
        }
    }
}